package com.towker.core.db;

public class DbContextHolder
{
	private static final ThreadLocal contextHolder = new ThreadLocal();

	public static void setDbType(String dbType)
	{
		contextHolder.set(dbType);
	}

	/**
	 * 取得dbtype类型
	 * @return
	 */
	public static String getDbType()
	{
		String str = (String) contextHolder.get();
		if (null == str || "".equals(str))
			str = "1";
		return str;
	}

	public static void clearDbType()
	{
		contextHolder.remove();
	}
}
